package a.f.e;

import a.c.*;
import a.c.d;
import a.c.e;
import a.c.m;
import a.f.fc;

import java.util.Comparator;

public class c
  extends b
{
  private static final double bb = -100.0D;
  private x cb;
  public static int db;
  
  private bb e(g[] paramArrayOfg)
  {
    int j = a.B;
    int i = a.A;
    this.cb = this.W.B();
    Object localObject1 = this.W.v();
    if (((w)localObject1).e()) {}
    while (j != 0)
    {
      localObject2 = (fc)this.X.get(((w)localObject1).d());
      this.cb.a(((w)localObject1).d(), a((fc)localObject2));
      ((w)localObject1).f();
      if (i == 0) {
        break;
      }
    }
    localObject1 = new bb();
    Object localObject2 = new boolean[paramArrayOfg.length];
    a_ locala_ = new a_();
    locala_.a(new bb(this.W.v()));
    boolean[] arrayOfBoolean = new boolean[this.W.k()];
    label378:
    do
    {
      do
      {
        if (locala_.a()) {
          break label409;
        }
        e locale1 = locala_.b();
        if ((j == 0) && (i != 0)) {
          return localObject1;
        }
        if (j != 0) {
          break;
        }
        if (localObject2[this.Z.getInt(locale1)] == 0)
        {
          ((bb)localObject1).add(locale1);
          localObject2[this.Z.getInt(locale1)] = 1;
          m localm = locale1.l();
          do
          {
            if (!localm.e()) {
              break label390;
            }
            d locald = localm.a();
            e locale2 = locald.a(locale1);
            if (i != 0) {
              break;
            }
            if (arrayOfBoolean[locale2.f()] == 0)
            {
              if (j != 0) {
                continue;
              }
              if (localObject2[this.Z.getInt(locale2)] == 0)
              {
                double d1 = this.cb.getDouble(locale2);
                double d2 = d1 - this.H.getDouble(locald) * s();
                if (j == 0)
                {
                  if (d2 < -100.0D)
                  {
                    locala_.b(locale2);
                    arrayOfBoolean[locale2.f()] = true;
                  }
                }
                else
                {
                  if (j != 0) {
                    continue;
                  }
                  if (i == 0) {
                    break label378;
                  }
                }
                locala_.a(locale2, d2);
              }
            }
            localm.f();
          } while (i == 0);
        }
        arrayOfBoolean[locale1.f()] = true;
      } while (j != 0);
    } while (i == 0);
    label390:
    label409:
    if (j == 0) {
      this.W.a(this.cb);
    }
    return localObject1;
  }
  
  bb d(g[] paramArrayOfg)
  {
    int j = a.B;
    int i = a.A;
    if (j == 0) {
      if (p() != 4) {
        return e(paramArrayOfg);
      }
    }
    this.cb = r();
    bb localbb1 = new bb(this.W.v());
    localbb1.a(new b_(paramArrayOfg));
    bb localbb2 = new bb();
    boolean[] arrayOfBoolean1 = new boolean[paramArrayOfg.length];
    boolean[] arrayOfBoolean2 = new boolean[this.W.k()];
    w localw1 = localbb1.l();
    label240:
    label242:
    do
    {
      do
      {
        if (!localw1.e()) {
          return localbb2;
        }
        e locale = localw1.d();
        if (((j != 0) || (arrayOfBoolean2[locale.f()] == 0)) && ((j != 0) || (arrayOfBoolean1[this.Z.getInt(locale)] == 0)))
        {
          localbb2.add(locale);
          arrayOfBoolean1[this.Z.getInt(locale)] = true;
          w localw2 = locale.o();
          do
          {
            if (!localw2.e()) {
              break;
            }
            arrayOfBoolean2[localw2.d().f()] = true;
            localw2.f();
            if (j != 0) {
              break label242;
            }
            if (i != 0) {
              break label240;
            }
          } while (i == 0);
        }
      } while (j != 0);
      localw1.f();
    } while (i == 0);
    return localbb2;
  }
  
  class c_
    implements Comparator
  {
    c_() {}
    
    public int compare(Object paramObject1, Object paramObject2)
    {
      int i = a.B;
      e locale1 = (e)paramObject1;
      e locale2 = (e)paramObject2;
      double d1 = c.this.cb.getDouble(locale1);
      double d2 = c.this.cb.getDouble(locale2);
      if (i == 0) {
        if (d1 > d2) {
          return -1;
        }
      }
      if (i == 0) {
        if (d1 < d2) {
          return 1;
        }
      }
      return 0;
    }
  }
  
  class a_
    implements n
  {
    a.i.a.c a = new a.i.a.c(c.this.W);
    
    public a_() {}
    
    public void a(bb parambb)
    {
      int j = a.B;
      int i = a.A;
      do
      {
        w localw = parambb.l();
        while (i == 0)
        {
          if (!localw.e()) {
            break;
          }
          a(localw.d());
          localw.f();
        }
      } while (j != 0);
    }
    
    public void a(e parame)
    {
      this.a.a(parame, -100.0D - c.this.cb.getDouble(parame));
    }
    
    public void b(e parame)
    {
      this.a.c(parame);
    }
    
    public boolean a()
    {
      return this.a.a();
    }
    
    public e b()
    {
      return this.a.b();
    }
    
    public void a(e parame, double paramDouble)
    {
      c.this.cb.a(parame, paramDouble);
      this.a.c(parame, -100.0D - paramDouble);
    }
  }
  
  class b_
    implements Comparator
  {
    g[] a;
    
    b_(g[] paramArrayOfg)
    {
      this.a = paramArrayOfg;
    }
    
    public int compare(Object paramObject1, Object paramObject2)
    {
      int i = a.B;
      e locale1 = (e)paramObject1;
      e locale2 = (e)paramObject2;
      boolean bool1 = this.a[c.this.Z.getInt(locale1)].c();
      boolean bool2 = this.a[c.this.Z.getInt(locale2)].c();
      if (i == 0) {
        if (bool1)
        {
          if (i != 0) {
            break label87;
          }
          if (bool2) {
            return 0;
          }
        }
      }
      label87:
      if (i == 0) {
        if (bool1) {
          return -1;
        }
      }
      if (i == 0) {
        if (bool2) {
          return 1;
        }
      }
      if (i == 0) {
        if (c.this.cb.getDouble(locale1) < c.this.cb.getDouble(locale2)) {
          return 1;
        }
      }
      if (i == 0) {
        if (c.this.cb.getDouble(locale2) < c.this.cb.getDouble(locale1)) {
          return -1;
        }
      }
      return 0;
    }
    
    public boolean equals(Object paramObject)
    {
      return ((a.B == 0) && (this == paramObject)) || (((paramObject instanceof b_)) && (this.a == ((b_)paramObject).a));
    }
    
    public int hashCode()
    {
      return (a.B != 0) || (this.a != null) ? this.a.hashCode() : 0;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.e.c

 * JD-Core Version:    0.7.0.1

 */